<!--菜单搜索功能-->
<!--先写静态页面-->
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>Green-download</title>
    <style>
        * {
            box-sizing: border-box;
        }
        
        .container {
            padding: 10px;
        }
        
        .dnav {
            float: left;
            padding: 5px;
            background: grey;
        }
        
        .dnav ul {
            list-style-type: none;
            margin: 10px;
            padding: 0px;
        }
        
        .dnav ul li {
            height: 20px;
        }
        
        .dnav ul li a {
            padding: 10px;
            margin: 20px;
            text-decoration: none;
            font-size: 18px;
            color: black;
            display: block
        }
        
        .dnav ul li a:hover {
            color: white;
        }
        
        .dnav input {
            width: 100%;
            font-size: 18px;
            padding: 11px;
            border: 1px solid #ddd;
        }
        
        .content {
            float: left;
            width: 70%;
            padding: 5px;
            background: lightgrey;
        }
    </style>
</head>

<body>
    <div class="container">
        <!--左右布局的实例-->
        <div class="dnav">
            <nav class="nav">
                <h2>索引
                    <h2>
                        <input placeholder="请输入关键字" id="mysearch" onkeyup="search()">
                        <ul>
                            <li><a href="./index/Eclipse.html">Eclipse[java IDE]</a></li>
                            <li><a href="./Software-download/Software-download.HTML">软件下载[Software download]</a></li>
                            <li><a href="./index/Debug.html">解决方案[DEBUG]</a></li>
                        </ul>
            </nav>
        </div>
        <div class="content">
            <h1>----Welcome----</h1>
            <h2>_UPLOAD-log></h2>
            <h3>2021-5-3 upload</h3>
            <p>Added "Babel Language"</p>
            <h3>2021-5-3 upload</h3>
            <p>
                Added "JavaFX Scene Builder"
            </p>
            <h3>2021-5-3 upload</h3>
            <p>
                Added "Eclipse & Eclpise's plug-in unit"
            </p>

        </div>
    </div>
    <script>
        //功能：主要是过滤，通过转换为大写toUpperCase,然后用indexOff来查询返回字符串位子，无就返回-1
        function search() {
            var input = document.getElementById("mysearch").value;
            var li = document.getElementsByTagName("li");
            var fliter = input.toUpperCase();
            for (var i = 0; i < li.length; i++) {
                if (li[i].innerHTML.toUpperCase().indexOf(fliter) > -1) {
                    li[i].style.display = "block";
                } else {
                    li[i].style.display = "none";
                }

            }

        }
    </script>
</body>

</html>